<div class="containertable">

<!-- Start Content -->

<table cellspacing="0" class="box">
	<tr>
		<th colspan="2">{$ad_title}</th>
	</tr>
	<tr>
	<td colspan="2">
	
	<!-- # Option menu Start -->
	<table id="tools" width="100%">
	<tr>
	<td>
			{if $fav_remove_link}
				<a href="javascript:openWin2('fav_popup.php?remove_fav={$ad_id}',220,130,'{$REMOVE_FAV}')" id="addfav">{$smarty.const.LA_REMOVE_FAV}</a>
			{elseif $fav_add_link}
				<a href="javascript:openWin2('fav_popup.php?add_fav={$ad_id}',220,130,'{$ADD_FAV}')" id="addfav">{$smarty.const.LA_ADD_FAV}</a>
			{/if}
	</td>
	
	<td><a href="{$link_adcat}" id="moread">{$smarty.const.LA_SIMILAR}</a></td>
	<td><a href="{$link_aduser}" id="sellerad">{$smarty.const.LA_SIMILAR_ADS}</a></td>
	<td class="resaltado_especial" ><a href="{$ad_link}&amp;contact=1"	id="contactseller">{$smarty.const.LA_CONTACT_SALE}</a>
	</td>
	<td><a href="{$ad_link}&amp;tellafriend=1" id="tellfriend">
		{$smarty.const.LA_TELL_A_FRIEND}</a>
	</td>
	<td style="border:none;">
		<a href="{$ad_link}&amp;print=1" id="print">{$smarty.const.LA_PRINT}</a>
	</td>
	</tr>
	</table>
	<!-- # Option menu End -->
	
	</td>
	</tr>
	<tr>
		<td colspan="2">
		{if $prev_link}
			<p style="float:left;"><a href="{$prev_link}" class="button">&laquo; {$smarty.const.PREVIOUS_ADS}</a></p>
		{/if}
		{if $next_link}
			<p style="float:right;"><a href="{$next_link}" class="button">{$smarty.const.LA_N} &raquo;</a></p>
		{/if}
		</td>
	</tr>
<tr>
	<td>
	
	
	{if $VENDOR_URL AND $VENDOR_HOMEPAGE AND $IS_VENDOR}
	<a href='{$VENDOR_HOMEPAGE}' target='new'><img src='{$VENDOR_URL}' border='0'></a>
	{elseif $VENDOR_HOMEPAGE AND $IS_VENDOR}
	<a href='{$VENDOR_HOMEPAGE}' target='new'>{$VENDOR_HOMEPAGE}</a>
	{elseif $VENDOR_URL AND $IS_VENDOR}
	<img src="{$VENDOR_URL}" alt="" />
	{/if}
	
	

			<h1>{$ad_title}</h1>
			{if $sold==1}<p class="sold"><b>{$smarty.const.LA_AD_IS_SOLD}</b></p>{/if}
			
			
			<form method="post" action="detail.php">
			<table width="100%" style="align:left">
			<tr>
				<td colspan="2" bgcolor="#343434"><h2>{$smarty.const.DESCRIPTION}:</h2></td>
			</tr>
			<tr>
				<td colspan="2">
					<div style="overflow:auto; height:560px; width:700px;align:center;margin-left:30px; margin-top:20px;">{$ad_description}</div>
				</td>
			</tr>
			<tr>
				<td colspan="2"><h2>{$smarty.const.GENERAL_DETAILS}:</h2></td>
			</tr>
			<tr>
				<td>{$smarty.const.SOLD_BY_TEXT}:</td>
				<td><b><a href='user_info.php?user_id={$user_id}&amp;id={$ad_id}'>{$ad_username}</a></b> 
				
				<!-- RATE MEMBERS -->
			    {if $rate_member}
			    	({$ad_member_votes} / # {$ad_member_voters})
			    	{if $rate_member_requires_login && !$isLoggedIn}
			    	{else}
			    	 	<small> <a href='javascript:openWin2("rate_member.php?user_id={$user_id}",300,260)'>
			    	 	<u>{$smarty.const.LA_GRADE_DETAIL} {$ad_username}</u></a> </small> 
			    	{/if}
			    {/if} 
			       
				</td>
			</tr>
			<tr>
				<td>{$smarty.const.ADD_USER_EMAIL}:</td>
				<td>
				{if $hide_email}
					<a href="detail.php?id={$ad_id}&amp;user_id={$user_id}&amp;contact=1">
					{$smarty.const.LA_CONTACT_SALE}</a>
				{else}
					<a href="mailto:{$email}">{$email}</a>
				{/if}
				
				
				{if $rafleaf}
					<br /><br />
					{if $rapleaf_member=="yes"}
						<a href="{$rapleaf_profile_url}" target="_blank">
						<img src="layout_images/rapleaf.gif" border="0" /></a><br />
						Score so far: <b>{$rapleaf_score}</b>
					{else}
						<a href="http://www.rapleaf.com/user_action?show=register" target="_blank">
						<img src="layout_images/rapleaf.gif" border="0" /></a><br />
						This ad holder is not a Rapleaf member yet!
						</a>
					{/if}
				
				{/if}
				
				</td>
			</tr>

				
			<!-- Extra Fields: USERS Start  -->  
			{foreach item=e from=$users}
			
			{if $e.value}
				{if $e.description}
					<tr><td colspan="2">
				   		<h2>{$e.description}</h2>
					</td></tr>
				{/if}
				
				<tr>
					<td valign="top">{$e.question}</td>
				   	<td valign="top">
				   	{if $e.islink}
				   		<a href='{$e.value}' target='new' title='{$e.value}' />{$e.value|truncate:70:"...":true}</a>
				   	{else}
				   		{$e.value}
				   	{/if}
				   	
				   	
				   	
				   	</td>
				</tr>
			{/if}
			
			{/foreach} 
			<!-- Extra Fields: USERS Stop  -->  
				
			
			<tr>
				<td colspan="2"><h2>{$smarty.const.AD_DETAILS_TEXT}</h2></td>
			</tr>
			
			 
			<!-- Extra Fields: ADS Start  -->  
			{foreach item=e from=$ads}
			
			{if $e.value}
				{if $e.description}
					<tr><td colspan="2">
				   		<h2>{$e.description}</h2>
					</td></tr>
				{/if}
				
				<tr>
					<td valign="top">{$e.question}</td>
				   	<td valign="top">
				   	{if $e.islink}
				   		<a href='{$e.value}' target='new' title='{$e.value}' />{$e.value|truncate:70:"...":true}</a>
				   	{else}
				   		{$e.value}
				   		
				   		{if $e.type=="p"}
				   			{$set_currency_text}
				   		{/if}
				   	{/if}
				   	
				   	</td>
				</tr>
			{/if}
			
			{/foreach} 
			<!-- Extra Fields: ADS Stop  -->  
			
			<tr>
				<td>{$smarty.const.LA_ADID}:</td><td> {$ad_id} </td>
			</tr>
			{if $regionid}
			<tr>
				<td>{$smarty.const.LA_REGION}:</td><td> 
				
					{foreach item=reg from=$region name=regions}
					{$reg.reg_name} 
					
					{if !$smarty.foreach.regions.last}
						/
					{/if}
					{/foreach}
					
					
				 </td>
			</tr>
			{/if}
			<tr>
				<td>{$smarty.const.AD_VIEWS}:</td><td>{$ad_hits}</td>
			</tr>
			<tr>
				<td>{$smarty.const.LA_AD_EXPIRE}:</td>
				<td> {$ad_expire} ({$smarty.const.LA_IN} {$num_days} {$smarty.const.DAYS})</td>
			</tr>
			<tr>
				<td>{$smarty.const.DATE_ADDED}:</td><td> {$ad_added}</td>
			</tr>
			
			<!-- RATE AD -->
			{if $rate_ad}
			<tr>
			<td> {$smarty.const.LA_CURR_GRADE} </td>
			<td> {$ad_vote_img_result} ({$smarty.const.LA_AFTER} {$ad_ad_voters} {$smarty.const.LA_VOTES})
				
				{if $rate_ad_requires_login && !$isLoggedIn}
				{else}
					
				 	<small> <a href='javascript:openWin2("rate.php?id={$ad_id}",300,250)'>
				 	<u>{$smarty.const.LA_GRADE_DETAIL}</u></a> </small> 
				{/if}
			
			
			</td>
			</tr>
			{/if}
			
			
			{if $set_comment_system}
			<tr>
				<td colspan="2"><h2>{$smarty.const.LA_COMMENT}</h2></td>
			</tr>
			{if $comment_list}
			{foreach item=c from=$comment_list}
			<tr>
			<td width="150">#{$c.comment_id} {$smarty.const.LA_BY} <a href='user_info.php?user_id={$c.comment_userid}' alt=''>{$c.comment_by}</a>
			<br />&nbsp;&nbsp;&nbsp;{$c.comment_date} {if $user_id==$isLoggedIn && $set_comment_admin_del} <a href='?id={$ad_id}&del={$c.comment_id}'><img src='layout_images/new/ad_delete.gif' border="0" /></a> {/if}
			</td>
			<td>{$c.comment_body}</td>
			</tr>
			{/foreach}
			{/if}
			
			
			<tr>
				<td colspan="2">
				
				{if $set_comment_done}
				<b>{$smarty.const.LA_COMMENT_RECORDED}</b>
				{/if}
				<p></p>
				
				{$smarty.const.LA_COMMENT_QUESTION}
				{if !$isLoggedIn} {$smarty.const.LA_COMMENT_QUESTION2}.{/if}				
				<input type="hidden" name="id" value="{$ad_id}" />
				
				
				</td>
			</tr>
			<!--
			
			<tr>
				<td>Title:</td>
				<td><input type="text" name="com_title" value="" size="39"></td>
			</tr>
			-->
			{if $isLoggedIn}
			<tr>	
				<td>{$smarty.const.LA_COMMENT}</td>
				<td><textarea cols="40" rows="5" name="comment_body"></textarea></td>
			</tr>
			
			<tr>
				<td colspan="2"><input type="submit" name="submit" value="{$smarty.const.LA_COMMENT_ADD}"></td>
			</tr>
			{/if}
			
			{/if}
			
			
			
			{if $googlemaps}
			<tr>
				<td colspan="2">
			<div id="map" style="width: 500px; height: 250px"></div>
			</td>
			</tr>
			{/if}
			
			</table>
			
			</form>

						
	</td>
	<td align="right">
		<br /><br />
		<!-- START Images and videos -->
	
		
		
		{if $set_slideshow AND $num_pictures>1  AND !$show_still}
		
		<script language="javascript">
		var imgArray=new Array({$num_pictures});
		var switchImage={$set_slideShow_sec};
		var switchImageCountFrom={$set_slideShow_count_from};
		{foreach item=image from=$image_list}
			imgArray[{$image.nr}]="{$image.file}";
		{/foreach}
		</script>
		{else}
		{foreach item=image from=$image_list}
			
			<a href="images/{$image.file_large}" rel="lightbox[large]" title="{$ad_title}" class="thumb">
			<!-- <a href="javascript:openLargeImage('large_picture.php?id={$image.id}')" class="thumb"> -->
			{if $set_image_program==0}
				<img src='images/{$image.file}' border='0' width="{$image.w}" heigth="{$image.h}" alt='' />
			{else}
				<img src='images/{$image.file}' border='0' alt='' />
			{/if}
			</a>
			<br /><br />
		{/foreach} 
		{/if}
		
		{if $show_still}
		<center><a href="?id={$ad_id}"><b>{$smarty.const.LA_SHOW_SHOW}</b></a></center>
		{/if}
		
		{if $set_slideshow AND $num_pictures>1 AND !$show_still}
		<p align="center"><b>{$smarty.const.LA_SLIDESHOW}</b></p>
		<img src="layout_images/blank.gif" alt='' id="gal_image" {if $image_max} width="{$image_max}" {/if} /><br /><br />
		{$smarty.const.LA_NEXT_SLIDE} <span id="co" align="center"></span></p>

		<center><a href="?id={$ad_id}&show_still=1"><b>{$smarty.const.LA_SHOW_STILL}</b></a></center>
		
		{literal}
		<script language="javascript">
		var n=0;
		var count=switchImageCountFrom;
		function slideShowImages()
		{
			n++;
			if (n==imgArray.length)
				n=0;		
			document.getElementById("gal_image").src="images/" + imgArray[n];
			setTimeout('slideShowImages();',switchImage);
			
		}
		
		function countDown()
		{
			document.getElementById("co").innerHTML=count--;
			setTimeout('countDown();',1000);
			if (count==0)
				count=switchImageCountFrom;
		}
		
		slideShowImages();
		countDown();
		</script>
		{/literal}
		{/if}
		
		
		{if $video_list}
		{foreach item=video from=$video_list}
		
		
		<b>{$video.file}</b><br />
		
		{if $video.ext=="avi" || $video.ext=="wmv"}
			<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
			<param name="FileName" value="images/videos/{$video.file}" />
			<param name="autostart" value="false" />
			<embed type='application/x-mplayer2'
			pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
			src="images/videos/{$video.file}" autostart="false" loop="false">
			</embed></object>
		{elseif $video.ext=="mov"}
			
			<object width="240" height="196" 
			classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" 
			codebase="http://www.apple.com/qtactivex/qtplugin.cab">
			<param name="src" value="images/videos/{$video.file}" />
			<param name="controller" value="true" />
			<param name="autoplay" value="true" />
			<embed src="images/videos/{$video.file}"   
			autoplay="true" controller="true" 
			pluginspage="http://www.apple.com/quicktime/download/">
			</embed>
			</object>
		{elseif $video.ext=="rm" || $video.ext=="ram" || $video.ext=="mpg"}
			<object id='rvocx' classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'
			width="320" height="240">
			<param name='src' value="images/videos/{$video.file}" />
			<param name='autostart' value="false" />
			<param name='controls' value='imagewindow' />
			<param name='console' value='video' />
			<param name='loop' value="false" />
			<embed src="images/videos/{$video.file}" width="320" height="240" 
			loop="true" type='audio/x-pn-realaudio-plugin' controls='imagewindow' console='video' autostart="false">
			</embed>
			</object>
			
		{/if}
		<br /><br />
		{/foreach}
		{/if}
		
		
		
		{if $doc_list}
		<table class="box" cellpadding="0" cellspacing="0">
		<tr><th>{$smarty.const.LA_UPLOADED_FILE}</th><th width="40">{$smarty.const.LA_SIZE}</th></tr>
		{foreach item=image from=$doc_list}  
			
			<tr>
			<td>
			<img src="layout_images/new/{$image.ext}.gif" 
		hspace="10" align="left" border="0" alt="{$image.ext}" />
			<a href="images/docs/{$image.name}" target="_blank" title="{$image.display_name}">
			{$image.display_name|truncate:20:"...":true}</a></td>
			<td>{$image.size} {$smarty.const.LA_KB}</td>
			</tr>
		{/foreach}
		</table>
		{/if}
		
		<!-- END Images and videos -->
	

			

	
	
</td>
</tr>
</table>

{if $googlemaps && $region_name!=""} 
	
	{literal}
	<script language="javascript">
	<!--
	 load();

	//showAddress("1600 Amphitheatre Pky, Mountain View, CA");
	showAddress("{/literal}{$region_name}{literal}");
	-->
	</script>
	{/literal}
{/if}



<!-- End Content -->
</div>